package com.base.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.base.mapper.voipmapper.RechargeablecardsMapper;
import com.base.po.sqlparam.RechargeablecardsExamplePage;
import com.base.po.voip.Rechargeablecards;
import com.base.po.voip.RechargeablecardsExample;
import com.base.service.RechargeablecardsService;
import com.base.utils.Page;
import com.base.utils.Produce;
import org.springframework.stereotype.Service;

@Service("rechargeablecardsService")
public class RechargeablecardsServiceImpl implements RechargeablecardsService {
	@Autowired
	RechargeablecardsMapper callbackinfoesMapper;

	@Override
	public int countByExample(RechargeablecardsExample example) {
		return callbackinfoesMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(RechargeablecardsExample example) {
		return callbackinfoesMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return callbackinfoesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(String cardno, String pwd, Integer money, String parentid, Integer status, Integer termofvalidity,
			Integer probationperiod, String feelroute, Boolean datastatus, String batch, Date usetime, String mobile,
			String picpath, Integer type, String number) {
		Rechargeablecards record = new Rechargeablecards(Produce.getUUID(), cardno, pwd, money, parentid, status,
				termofvalidity, probationperiod, feelroute, datastatus, batch, Produce.getNowDate(), usetime, mobile,
				picpath, type, number);
		return callbackinfoesMapper.insert(record);
	}

	@Override
	public int insertSelective(Rechargeablecards record) {
		return callbackinfoesMapper.insertSelective(record);
	}

	@Override
	public List<Rechargeablecards> selectByExample(RechargeablecardsExample example) {
		return callbackinfoesMapper.selectByExample(example);
	}

	@Override
	public List<Rechargeablecards> selectByExamplePage(RechargeablecardsExamplePage example) {
		return callbackinfoesMapper.selectByExamplePage(example);
	}

	@Override
	public Rechargeablecards selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return callbackinfoesMapper.selectByPrimaryKey(id);
	}

	@Override
	public String selectMaxCardNo() {
		return callbackinfoesMapper.selectMaxCardNo();
	}

	@Override
	public List<Rechargeablecards> selectCard(String parentid, String batch) {
		return callbackinfoesMapper.selectCard(parentid, batch);
	}

	@Override
	public int updateByExampleSelective(Rechargeablecards record, RechargeablecardsExample example) {
		return callbackinfoesMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Rechargeablecards record, RechargeablecardsExample example) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(Rechargeablecards record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Rechargeablecards record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKey(record);
	}

	@Override
	public int insertCards(List<Rechargeablecards> example) {
		return callbackinfoesMapper.insertCards(example);
	}

	@Override
	public List<Rechargeablecards> selectByShopid(Page page, String shopid, Integer status, String batch, Integer money,
			String mobile, String id, String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom,
			String cardnoTo, Boolean datastatus) {
		
		return callbackinfoesMapper.selectByShopid(page, shopid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus);
	}

	@Override
	public int countByShopid(String shopid, Integer status, String batch, Integer money, String mobile, String id,
			String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo,
			Boolean datastatus) {
		
		return callbackinfoesMapper.countByShopid(shopid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus);
	}

	@Override
	public List<Rechargeablecards> selectByAll(Page page, Integer status, String batch, Integer money, String mobile,
			String parentid, String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom,
			String cardnoTo, Boolean datastatus, Integer type, String feelroute) {
		
		return callbackinfoesMapper.selectByAll(page, status, batch, money, mobile, parentid, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}

	@Override
	public int countByAll(Integer status, String batch, Integer money, String mobile, String parentid, String cardno,
			Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo, Boolean datastatus,
			Integer type, String feelroute) {
		
		return callbackinfoesMapper.countByAll(status, batch, money, mobile, parentid, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}

	@Override
	public List<Rechargeablecards> selectByParentid(Page page, String parentid, Integer status, String batch,
			Integer money, String mobile, String id, String cardno, Integer termofvalidity, Integer probationperiod,
			String cardnoFrom, String cardnoTo, Boolean datastatus, Integer type, String feelroute) {
		
		return callbackinfoesMapper.selectByParentid(page, parentid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}

	@Override
	public int countByParentid(String parentid, Integer status, String batch, Integer money, String mobile, String id,
			String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo,
			Boolean datastatus, Integer type, String feelroute) {
		
		return callbackinfoesMapper.countByParentid(parentid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}
	
	@Override
	public List<Rechargeablecards> selectByShopidNotAll(Page page, String shopid, Integer status, String batch,
			Integer money, String mobile, String id, String cardno, Integer termofvalidity, Integer probationperiod,
			String cardnoFrom, String cardnoTo, Boolean datastatus, Integer type, String feelroute) {
		
		return callbackinfoesMapper.selectByShopidNotAll(page, shopid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}

	@Override
	public int countByShopidNotAll(String shopid, Integer status, String batch, Integer money, String mobile, String id,
			String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo,
			Boolean datastatus, Integer type, String feelroute) {
		
		return callbackinfoesMapper.countByShopidNotAll(shopid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}

	@Override
	public int updateByCardNo(String parentId, String cardnoFrom, String cardnoTo) {
		return callbackinfoesMapper.updateByCardNo(parentId, cardnoFrom, cardnoTo);
	}

	@Override
	public int countByParentidusetime(String parentid, Integer status, String batch, Integer money, String mobile, String id, String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo, Boolean datastatus, Integer type, String feelroute, Date usetime1,Date usetime2) {
		return callbackinfoesMapper.countByParentidusertime(parentid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute,usetime1,usetime2);
	}

	@Override
	public List<Rechargeablecards> selectByParentidusetime(Page page, String parentid, Integer status, String batch, Integer money, String mobile, String id, String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo, Boolean datastatus, Integer type, String feelroute, Date usetime1,Date usetime2) {
		return callbackinfoesMapper.selectByParentidusetime(page, parentid, status, batch, money, mobile, id, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute,usetime1,usetime2);
	}

	@Override
	public  List<String> selectCardsCountBymoney(String userid, String usetime1, String usetime2) {

		return callbackinfoesMapper.selectCardsCountBymoney(userid,usetime1,usetime2);
	}

	@Override
	public List<Rechargeablecards> selectByAllNotOrder(Page page, Integer sStatus, String sBatch, Integer sMoney, String sMobile, String pId, String sCardno, Integer sTermofvalidity, Integer sProbationperiod, String sCardnoFrom, String sCardnoTo, Boolean sDatastatus, Integer sType, String sFeelroute) {
		return callbackinfoesMapper.selectByAllNotOrder( page,  sStatus,  sBatch,  sMoney,  sMobile,  pId,  sCardno,  sTermofvalidity,  sProbationperiod,  sCardnoFrom,  sCardnoTo,  sDatastatus,  sType,  sFeelroute);
	}

	@Override
	public int batchAddCards(List<Rechargeablecards> list) {
		return callbackinfoesMapper.batchAddCards(list);
	}

	@Override
	public int countByAllNew(Integer status, String batch, Integer money, String mobile, List<String> parentid, String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo, Boolean datastatus, Integer type, String feelroute) {
		return callbackinfoesMapper.countByAllNew(status, batch, money, mobile, parentid, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);
	}

	@Override
	public List<Rechargeablecards> selectByAllNew(Page page, Integer status, String batch, Integer money, String mobile, List<String> parentid, String cardno, Integer termofvalidity, Integer probationperiod, String cardnoFrom, String cardnoTo, Boolean datastatus, Integer type, String feelroute) {
		return callbackinfoesMapper.selectByAllNew(page, status, batch, money, mobile, parentid, cardno, termofvalidity, probationperiod, cardnoFrom, cardnoTo, datastatus, type, feelroute);

	}

	@Override
	public List<Rechargeablecards> selectByCPS(String cardno, String pwd, int status) {
		return callbackinfoesMapper.selectByCPS(cardno,pwd,status);
	}

	@Override
	public String selectMaxCards(String sBatch) {
		return callbackinfoesMapper.selectMaxCards(sBatch);
	}

	@Override
	public String selectMinCards(String sBatch) {
		return callbackinfoesMapper.selectMinCards(sBatch);
	}

	@Override
	public int updateBatchAndCardsBetween(String batch, String cardnoFrom, String cardnoTo, String userid) {
		return callbackinfoesMapper.updateBatchAndCardsBetween(batch, cardnoFrom, cardnoTo, userid);
	}

	@Override
	public List<Rechargeablecards> selectByCardNo(String cardno) {
		
		return callbackinfoesMapper.selectByCardNo(cardno);
	}

}
